home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6436 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: news.compuserve.com!newsmaster
  2. From: 100435.736@compuserve.com (David A. Mair)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: CListBox-Problem Multisel <->Singlesel
  5. Date: Thu, 08 Feb 1996 09:41:11 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4fcgfu$4ap@dub-news-svc-5.compuserve.com>
  8. References: <4faep7$eih@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: dd55-007.compuserve.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. bmatejek@aol.com (BMatejek) wrote:
  13.  
  14. >Hi folks!
  15.  
  16. >I have a big problem -for me. I try to change the ListBox attribute after
  17. >having created the Dialog with this ListBox and before opening this
  18. >special dialog.
  19.  
  20. >Therefor I tried the following terminologie:
  21.  
  22. >   CListDialog Dlg(this);  //with member CListBox m_List
  23. >   SetWindowLong(Dlg.m_List.m_hWnd, GWL_STYLE,    
  24. >GetWindowLong(Dlg.m_List.m_hWnd, GWL_STYLE) | LBS_MULTIPLESELE);
  25. >  Dlg.DoModal();
  26.  
  27. >BUT IT DOESN T  WORK!
  28.  
  29. >In the resource editor I marked the single selection attribute, because I
  30. >need this dialog for other functions.
  31.  
  32. >It would be very kind if you could help me.
  33.  
  34. Well, your a little off topic, this is not a C++ question and you
  35. should probably re-post on comp.os.ms-windows.programmer.tools.mfc.
  36.  
  37. However, the answer to your question is documented in a few places.
  38. Microsoft state in programmer documentation that you cannot change the
  39. style of a list box from multiple select to single select or vice
  40. versa.  The only solution to this problem is to include two
  41. identically sized and placed list boxes on the dialog box and make one
  42. single select and one multiple select.  You must then show one and
  43. hide the other as appropriate.  Make sure that you populate both
  44. appropriately.
  45.  
  46. Regards
  47. David.
  48.  
  49.  
  50.